<?php
class Frontend_Table_Config extends Custom_Model_Table_Abstract
{
    protected $_name            = 'config';

    public function getConfig($option)
    {
        $option = (int)$option;
        $select = $this->select()->where('code = ?',$option);
        $config = $this->fetchRow($select);

        $arr = $config->toArray();
        if ('group' == $config->type) {
            $arr['options'] = $config->findDependentRowset(
                    'Frontend_Table_Configoptions',
                    'Config'
            )->toArray();
        }
        return $arr;
    }
}
